package androidx.core.view;

import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.content.res.ColorStateList;
import android.graphics.Paint;
import android.graphics.PorterDuff.Mode;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.util.Log;
import android.util.SparseArray;
import android.view.Display;
import android.view.KeyEvent;
import android.view.PointerIcon;
import android.view.View;
import android.view.View.AccessibilityDelegate;
import android.view.View.OnAttachStateChangeListener;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.Px;
import androidx.annotation.RequiresApi;
import androidx.annotation.UiThread;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Map.Entry;
import java.util.WeakHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import o.hc;
import o.hc.e;
import o.ho;
import o.hq;
import o.hx;
import o.hy;
import o.hz;
import o.ic;
import o.ij;
import o.in;

public class ViewCompat {
    private static ThreadLocal<Rect> ʻ;
    private static boolean ʼ = false;
    private static WeakHashMap<View, String> ʽ;
    private static final AtomicInteger ˊ = new AtomicInteger(1);
    private static b ˊॱ = new b();
    private static Field ˋ;
    private static boolean ˎ;
    private static boolean ˏ;
    private static final int[] ͺ = new int[]{o.ff.d.ˋ, o.ff.d.ॱ, o.ff.d.ˊॱ, o.ff.d.ʾ, o.ff.d.ˊˊ, o.ff.d.ˉ, o.ff.d.ˋˊ, o.ff.d.ˌ, o.ff.d.ˎˎ, o.ff.d.ˋᐝ, o.ff.d.ˊ, o.ff.d.ˏ, o.ff.d.ᐝ, o.ff.d.ʼ, o.ff.d.ʻ, o.ff.d.ॱॱ, o.ff.d.ʽ, o.ff.d.ॱˊ, o.ff.d.ˏॱ, o.ff.d.ˋॱ, o.ff.d.ͺ, o.ff.d.ॱᐝ, o.ff.d.ᐝॱ, o.ff.d.ʻॱ, o.ff.d.ॱˎ, o.ff.d.ॱˋ, o.ff.d.ʼॱ, o.ff.d.ʽॱ, o.ff.d.ʿ, o.ff.d.ˈ, o.ff.d.ˊᐝ, o.ff.d.ˊˋ};
    private static Field ॱ;
    private static Field ॱॱ;
    private static WeakHashMap<View, ic> ᐝ = null;

    static abstract class a<T> {
        private final int ˊ;
        private final Class<T> ˎ;
        private final int ˏ;
        private final int ॱ;

        abstract T ˊ(View view);

        a(int i, Class<T> cls, int i2) {
            this(i, cls, 0, i2);
        }

        a(int i, Class<T> cls, int i2, int i3) {
            this.ˏ = i;
            this.ˎ = cls;
            this.ˊ = i2;
            this.ॱ = i3;
        }

        T ˏ(View view) {
            if (ˋ()) {
                return ˊ(view);
            }
            if (ˎ()) {
                T tag = view.getTag(this.ˏ);
                if (this.ˎ.isInstance(tag)) {
                    return tag;
                }
            }
            return null;
        }

        private boolean ˋ() {
            return VERSION.SDK_INT >= this.ॱ;
        }

        private boolean ˎ() {
            return VERSION.SDK_INT >= 19;
        }
    }

    static class b implements OnGlobalLayoutListener, OnAttachStateChangeListener {
        private WeakHashMap<View, Boolean> ˋ = new WeakHashMap();

        b() {
        }

        @RequiresApi(19)
        public void onGlobalLayout() {
            for (Entry entry : this.ˋ.entrySet()) {
                ˎ((View) entry.getKey(), ((Boolean) entry.getValue()).booleanValue());
            }
        }

        @RequiresApi(19)
        public void onViewAttachedToWindow(View view) {
            ˏ(view);
        }

        public void onViewDetachedFromWindow(View view) {
        }

        @RequiresApi(19)
        private void ˎ(View view, boolean z) {
            boolean z2 = view.getVisibility() == 0;
            if (z != z2) {
                if (z2) {
                    ViewCompat.ᐝ(view, 16);
                }
                this.ˋ.put(view, Boolean.valueOf(z2));
            }
        }

        @RequiresApi(19)
        private void ˏ(View view) {
            view.getViewTreeObserver().addOnGlobalLayoutListener(this);
        }
    }

    public interface c {
        boolean ˏ(View view, KeyEvent keyEvent);
    }

    static class d {
        private static final ArrayList<WeakReference<View>> ॱ = new ArrayList();
        private SparseArray<WeakReference<View>> ˊ = null;
        private WeakReference<KeyEvent> ˎ = null;
        @Nullable
        private WeakHashMap<View, Boolean> ˏ = null;

        d() {
        }

        private SparseArray<WeakReference<View>> ˏ() {
            if (this.ˊ == null) {
                this.ˊ = new SparseArray();
            }
            return this.ˊ;
        }

        static d ˊ(View view) {
            d dVar = (d) view.getTag(o.ff.d.ˎˏ);
            if (dVar != null) {
                return dVar;
            }
            dVar = new d();
            view.setTag(o.ff.d.ˎˏ, dVar);
            return dVar;
        }

        boolean ˊ(View view, KeyEvent keyEvent) {
            if (keyEvent.getAction() == 0) {
                ॱ();
            }
            View ˋ = ˋ(view, keyEvent);
            if (keyEvent.getAction() == 0) {
                int keyCode = keyEvent.getKeyCode();
                if (!(ˋ == null || KeyEvent.isModifierKey(keyCode))) {
                    ˏ().put(keyCode, new WeakReference(ˋ));
                }
            }
            return ˋ != null;
        }

        @Nullable
        private View ˋ(View view, KeyEvent keyEvent) {
            if (this.ˏ == null || !this.ˏ.containsKey(view)) {
                return null;
            }
            if (view instanceof ViewGroup) {
                ViewGroup viewGroup = (ViewGroup) view;
                for (int childCount = viewGroup.getChildCount() - 1; childCount >= 0; childCount--) {
                    View ˋ = ˋ(viewGroup.getChildAt(childCount), keyEvent);
                    if (ˋ != null) {
                        return ˋ;
                    }
                }
            }
            if (ॱ(view, keyEvent)) {
                return view;
            }
            return null;
        }

        boolean ˋ(KeyEvent keyEvent) {
            if (this.ˎ != null && this.ˎ.get() == keyEvent) {
                return false;
            }
            this.ˎ = new WeakReference(keyEvent);
            WeakReference weakReference = null;
            SparseArray ˏ = ˏ();
            if (keyEvent.getAction() == 1) {
                int indexOfKey = ˏ.indexOfKey(keyEvent.getKeyCode());
                if (indexOfKey >= 0) {
                    weakReference = (WeakReference) ˏ.valueAt(indexOfKey);
                    ˏ.removeAt(indexOfKey);
                }
            }
            if (weakReference == null) {
                weakReference = (WeakReference) ˏ.get(keyEvent.getKeyCode());
            }
            if (weakReference == null) {
                return false;
            }
            View view = (View) weakReference.get();
            if (view != null && ViewCompat.ˋˊ(view)) {
                ॱ(view, keyEvent);
            }
            return true;
        }

        private boolean ॱ(@NonNull View view, @NonNull KeyEvent keyEvent) {
            ArrayList arrayList = (ArrayList) view.getTag(o.ff.d.ॱʼ);
            if (arrayList != null) {
                for (int size = arrayList.size() - 1; size >= 0; size--) {
                    if (((c) arrayList.get(size)).ˏ(view, keyEvent)) {
                        return true;
                    }
                }
            }
            return false;
        }

        private void ॱ() {
            if (this.ˏ != null) {
                this.ˏ.clear();
            }
            if (!ॱ.isEmpty()) {
                synchronized (ॱ) {
                    if (this.ˏ == null) {
                        this.ˏ = new WeakHashMap();
                    }
                    for (int size = ॱ.size() - 1; size >= 0; size--) {
                        View view = (View) ((WeakReference) ॱ.get(size)).get();
                        if (view == null) {
                            ॱ.remove(size);
                        } else {
                            this.ˏ.put(view, Boolean.TRUE);
                            for (ViewParent parent = view.getParent(); parent instanceof View; parent = parent.getParent()) {
                                this.ˏ.put((View) parent, Boolean.TRUE);
                            }
                        }
                    }
                }
            }
        }
    }

    private static Rect ˎ() {
        if (ʻ == null) {
            ʻ = new ThreadLocal();
        }
        Rect rect = (Rect) ʻ.get();
        if (rect == null) {
            rect = new Rect();
            ʻ.set(rect);
        }
        rect.setEmpty();
        return rect;
    }

    @Deprecated
    public static boolean ˏ(View view, int i) {
        return view.canScrollVertically(i);
    }

    public static void ॱ(@NonNull View view, in inVar) {
        view.onInitializeAccessibilityNodeInfo(inVar.ˏ());
    }

    public static void ˏ(@NonNull View view, hc hcVar) {
        if (hcVar == null && (ˋˋ(view) instanceof e)) {
            hcVar = new hc();
        }
        view.setAccessibilityDelegate(hcVar == null ? null : hcVar.ˊ());
    }

    @SuppressLint({"InlinedApi"})
    public static int ˏ(@NonNull View view) {
        if (VERSION.SDK_INT >= 26) {
            return view.getImportantForAutofill();
        }
        return 0;
    }

    public static void ˊ(@NonNull View view, int i) {
        if (VERSION.SDK_INT >= 26) {
            view.setImportantForAutofill(i);
        }
    }

    public static boolean ॱ(@NonNull View view) {
        return ˋˋ(view) != null;
    }

    @Nullable
    private static AccessibilityDelegate ˋˋ(@NonNull View view) {
        if (ʼ) {
            return null;
        }
        if (ॱॱ == null) {
            try {
                ॱॱ = View.class.getDeclaredField("mAccessibilityDelegate");
                ॱॱ.setAccessible(true);
            } catch (Throwable th) {
                ʼ = true;
                return null;
            }
        }
        try {
            Object obj = ॱॱ.get(view);
            if (obj instanceof AccessibilityDelegate) {
                return (AccessibilityDelegate) obj;
            }
            return null;
        } catch (Throwable th2) {
            ʼ = true;
            return null;
        }
    }

    public static boolean ˋ(@NonNull View view) {
        if (VERSION.SDK_INT >= 16) {
            return view.hasTransientState();
        }
        return false;
    }

    public static void ˋ(@NonNull View view, boolean z) {
        if (VERSION.SDK_INT >= 16) {
            view.setHasTransientState(z);
        }
    }

    public static void ˎ(@NonNull View view) {
        if (VERSION.SDK_INT >= 16) {
            view.postInvalidateOnAnimation();
        } else {
            view.postInvalidate();
        }
    }

    public static void ˋ(@NonNull View view, int i, int i2, int i3, int i4) {
        if (VERSION.SDK_INT >= 16) {
            view.postInvalidateOnAnimation(i, i2, i3, i4);
        } else {
            view.postInvalidate(i, i2, i3, i4);
        }
    }

    public static void ˏ(@NonNull View view, Runnable runnable) {
        if (VERSION.SDK_INT >= 16) {
            view.postOnAnimation(runnable);
        } else {
            view.postDelayed(runnable, ValueAnimator.getFrameDelay());
        }
    }

    public static void ˏ(@NonNull View view, Runnable runnable, long j) {
        if (VERSION.SDK_INT >= 16) {
            view.postOnAnimationDelayed(runnable, j);
        } else {
            view.postDelayed(runnable, ValueAnimator.getFrameDelay() + j);
        }
    }

    public static int getImportantForAccessibility(@NonNull View view) {
        if (VERSION.SDK_INT >= 16) {
            return view.getImportantForAccessibility();
        }
        return 0;
    }

    public static void setImportantForAccessibility(@NonNull View view, int i) {
        if (VERSION.SDK_INT >= 19) {
            view.setImportantForAccessibility(i);
        } else if (VERSION.SDK_INT >= 16) {
            if (i == 4) {
                i = 2;
            }
            view.setImportantForAccessibility(i);
        }
    }

    public static boolean ˊ(@NonNull View view, int i, Bundle bundle) {
        if (VERSION.SDK_INT >= 16) {
            return view.performAccessibilityAction(i, bundle);
        }
        return false;
    }

    public static void ˋ(@NonNull View view, Paint paint) {
        if (VERSION.SDK_INT >= 17) {
            view.setLayerPaint(paint);
            return;
        }
        view.setLayerType(view.getLayerType(), paint);
        view.invalidate();
    }

    public static int ʼ(@NonNull View view) {
        if (VERSION.SDK_INT >= 17) {
            return view.getLayoutDirection();
        }
        return 0;
    }

    public static ViewParent ʽ(@NonNull View view) {
        if (VERSION.SDK_INT >= 16) {
            return view.getParentForAccessibility();
        }
        return view.getParent();
    }

    public static int ॱॱ(@NonNull View view) {
        if (VERSION.SDK_INT >= 19) {
            return view.getAccessibilityLiveRegion();
        }
        return 0;
    }

    public static void ˋ(@NonNull View view, int i) {
        if (VERSION.SDK_INT >= 19) {
            view.setAccessibilityLiveRegion(i);
        }
    }

    @Px
    public static int ʻ(@NonNull View view) {
        if (VERSION.SDK_INT >= 17) {
            return view.getPaddingStart();
        }
        return view.getPaddingLeft();
    }

    @Px
    public static int ᐝ(@NonNull View view) {
        if (VERSION.SDK_INT >= 17) {
            return view.getPaddingEnd();
        }
        return view.getPaddingRight();
    }

    public static void ˏ(@NonNull View view, @Px int i, @Px int i2, @Px int i3, @Px int i4) {
        if (VERSION.SDK_INT >= 17) {
            view.setPaddingRelative(i, i2, i3, i4);
        } else {
            view.setPadding(i, i2, i3, i4);
        }
    }

    public static int ॱˊ(@NonNull View view) {
        if (VERSION.SDK_INT >= 16) {
            return view.getMinimumWidth();
        }
        if (!ˏ) {
            try {
                ॱ = View.class.getDeclaredField("mMinWidth");
                ॱ.setAccessible(true);
            } catch (NoSuchFieldException e) {
            }
            ˏ = true;
        }
        if (ॱ != null) {
            try {
                return ((Integer) ॱ.get(view)).intValue();
            } catch (Exception e2) {
            }
        }
        return 0;
    }

    public static int ˋॱ(@NonNull View view) {
        if (VERSION.SDK_INT >= 16) {
            return view.getMinimumHeight();
        }
        if (!ˎ) {
            try {
                ˋ = View.class.getDeclaredField("mMinHeight");
                ˋ.setAccessible(true);
            } catch (NoSuchFieldException e) {
            }
            ˎ = true;
        }
        if (ˋ != null) {
            try {
                return ((Integer) ˋ.get(view)).intValue();
            } catch (Exception e2) {
            }
        }
        return 0;
    }

    @NonNull
    public static ic ˏॱ(@NonNull View view) {
        if (ᐝ == null) {
            ᐝ = new WeakHashMap();
        }
        ic icVar = (ic) ᐝ.get(view);
        if (icVar != null) {
            return icVar;
        }
        icVar = new ic(view);
        ᐝ.put(view, icVar);
        return icVar;
    }

    public static void ˋ(@NonNull View view, float f) {
        if (VERSION.SDK_INT >= 21) {
            view.setElevation(f);
        }
    }

    public static float ˊॱ(@NonNull View view) {
        if (VERSION.SDK_INT >= 21) {
            return view.getElevation();
        }
        return 0.0f;
    }

    public static void ˏ(@NonNull View view, float f) {
        if (VERSION.SDK_INT >= 21) {
            view.setTranslationZ(f);
        }
    }

    public static float ͺ(@NonNull View view) {
        if (VERSION.SDK_INT >= 21) {
            return view.getTranslationZ();
        }
        return 0.0f;
    }

    public static void ˏ(@NonNull View view, String str) {
        if (VERSION.SDK_INT >= 21) {
            view.setTransitionName(str);
            return;
        }
        if (ʽ == null) {
            ʽ = new WeakHashMap();
        }
        ʽ.put(view, str);
    }

    @Nullable
    public static String ॱˎ(@NonNull View view) {
        if (VERSION.SDK_INT >= 21) {
            return view.getTransitionName();
        }
        if (ʽ == null) {
            return null;
        }
        return (String) ʽ.get(view);
    }

    public static int ʻॱ(@NonNull View view) {
        if (VERSION.SDK_INT >= 16) {
            return view.getWindowSystemUiVisibility();
        }
        return 0;
    }

    public static void ᐝॱ(@NonNull View view) {
        if (VERSION.SDK_INT >= 20) {
            view.requestApplyInsets();
        } else if (VERSION.SDK_INT >= 16) {
            view.requestFitSystemWindows();
        }
    }

    public static boolean ॱˋ(@NonNull View view) {
        if (VERSION.SDK_INT >= 16) {
            return view.getFitsSystemWindows();
        }
        return false;
    }

    @Deprecated
    public static void ˎ(View view, boolean z) {
        view.setFitsSystemWindows(z);
    }

    public static void ˋ(@NonNull View view, hx hxVar) {
        if (VERSION.SDK_INT < 21) {
            return;
        }
        if (hxVar == null) {
            view.setOnApplyWindowInsetsListener(null);
        } else {
            view.setOnApplyWindowInsetsListener(new 1(hxVar));
        }
    }

    public static ij ˊ(@NonNull View view, ij ijVar) {
        if (VERSION.SDK_INT < 21) {
            return ijVar;
        }
        Object obj = (WindowInsets) ij.ॱ(ijVar);
        WindowInsets onApplyWindowInsets = view.onApplyWindowInsets(obj);
        if (!onApplyWindowInsets.equals(obj)) {
            obj = new WindowInsets(onApplyWindowInsets);
        }
        return ij.ˊ(obj);
    }

    public static ij ॱ(@NonNull View view, ij ijVar) {
        if (VERSION.SDK_INT < 21) {
            return ijVar;
        }
        Object obj = (WindowInsets) ij.ॱ(ijVar);
        WindowInsets dispatchApplyWindowInsets = view.dispatchApplyWindowInsets(obj);
        if (!dispatchApplyWindowInsets.equals(obj)) {
            obj = new WindowInsets(dispatchApplyWindowInsets);
        }
        return ij.ˊ(obj);
    }

    public static boolean ॱᐝ(@NonNull View view) {
        if (VERSION.SDK_INT >= 16) {
            return view.hasOverlappingRendering();
        }
        return true;
    }

    public static boolean ʼॱ(@NonNull View view) {
        if (VERSION.SDK_INT >= 17) {
            return view.isPaddingRelative();
        }
        return false;
    }

    public static void ˏ(@NonNull View view, @Nullable Drawable drawable) {
        if (VERSION.SDK_INT >= 16) {
            view.setBackground(drawable);
        } else {
            view.setBackgroundDrawable(drawable);
        }
    }

    public static ColorStateList ʾ(@NonNull View view) {
        if (VERSION.SDK_INT >= 21) {
            return view.getBackgroundTintList();
        }
        return view instanceof hy ? ((hy) view).ˊ() : null;
    }

    public static void ˎ(@NonNull View view, ColorStateList colorStateList) {
        if (VERSION.SDK_INT >= 21) {
            view.setBackgroundTintList(colorStateList);
            if (VERSION.SDK_INT == 21) {
                Drawable background = view.getBackground();
                Object obj = (view.getBackgroundTintList() == null && view.getBackgroundTintMode() == null) ? null : 1;
                if (background != null && obj != null) {
                    if (background.isStateful()) {
                        background.setState(view.getDrawableState());
                    }
                    view.setBackground(background);
                }
            }
        } else if (view instanceof hy) {
            ((hy) view).setSupportBackgroundTintList(colorStateList);
        }
    }

    public static Mode ʿ(@NonNull View view) {
        if (VERSION.SDK_INT >= 21) {
            return view.getBackgroundTintMode();
        }
        return view instanceof hy ? ((hy) view).ॱ() : null;
    }

    public static void ˊ(@NonNull View view, Mode mode) {
        if (VERSION.SDK_INT >= 21) {
            view.setBackgroundTintMode(mode);
            if (VERSION.SDK_INT == 21) {
                Drawable background = view.getBackground();
                Object obj = (view.getBackgroundTintList() == null && view.getBackgroundTintMode() == null) ? null : 1;
                if (background != null && obj != null) {
                    if (background.isStateful()) {
                        background.setState(view.getDrawableState());
                    }
                    view.setBackground(background);
                }
            }
        } else if (view instanceof hy) {
            ((hy) view).setSupportBackgroundTintMode(mode);
        }
    }

    public static boolean ˈ(@NonNull View view) {
        if (VERSION.SDK_INT >= 21) {
            return view.isNestedScrollingEnabled();
        }
        if (view instanceof hq) {
            return ((hq) view).isNestedScrollingEnabled();
        }
        return false;
    }

    public static void ʽॱ(@NonNull View view) {
        if (VERSION.SDK_INT >= 21) {
            view.stopNestedScroll();
        } else if (view instanceof hq) {
            ((hq) view).stopNestedScroll();
        }
    }

    public static void ॱ(@NonNull View view, int i) {
        if (view instanceof ho) {
            ((ho) view).ˊ(i);
        } else if (i == 0) {
            ʽॱ(view);
        }
    }

    public static boolean ˊᐝ(@NonNull View view) {
        if (VERSION.SDK_INT >= 19) {
            return view.isLaidOut();
        }
        return view.getWidth() > 0 && view.getHeight() > 0;
    }

    public static float ˊˊ(@NonNull View view) {
        if (VERSION.SDK_INT >= 21) {
            return view.getZ();
        }
        return 0.0f;
    }

    public static void ʽ(@NonNull View view, int i) {
        if (VERSION.SDK_INT >= 23) {
            view.offsetTopAndBottom(i);
        } else if (VERSION.SDK_INT >= 21) {
            Object obj;
            Rect ˎ = ˎ();
            ViewParent parent = view.getParent();
            if (parent instanceof View) {
                View view2 = (View) parent;
                ˎ.set(view2.getLeft(), view2.getTop(), view2.getRight(), view2.getBottom());
                obj = !ˎ.intersects(view.getLeft(), view.getTop(), view.getRight(), view.getBottom()) ? 1 : null;
            } else {
                obj = null;
            }
            ʼ(view, i);
            if (obj != null && ˎ.intersect(view.getLeft(), view.getTop(), view.getRight(), view.getBottom())) {
                ((View) parent).invalidate(ˎ);
            }
        } else {
            ʼ(view, i);
        }
    }

    private static void ʼ(View view, int i) {
        view.offsetTopAndBottom(i);
        if (view.getVisibility() == 0) {
            ˏˎ(view);
            ViewParent parent = view.getParent();
            if (parent instanceof View) {
                ˏˎ((View) parent);
            }
        }
    }

    public static void ॱॱ(@NonNull View view, int i) {
        if (VERSION.SDK_INT >= 23) {
            view.offsetLeftAndRight(i);
        } else if (VERSION.SDK_INT >= 21) {
            Object obj;
            Rect ˎ = ˎ();
            ViewParent parent = view.getParent();
            if (parent instanceof View) {
                View view2 = (View) parent;
                ˎ.set(view2.getLeft(), view2.getTop(), view2.getRight(), view2.getBottom());
                obj = !ˎ.intersects(view.getLeft(), view.getTop(), view.getRight(), view.getBottom()) ? 1 : null;
            } else {
                obj = null;
            }
            ʻ(view, i);
            if (obj != null && ˎ.intersect(view.getLeft(), view.getTop(), view.getRight(), view.getBottom())) {
                ((View) parent).invalidate(ˎ);
            }
        } else {
            ʻ(view, i);
        }
    }

    private static void ʻ(View view, int i) {
        view.offsetLeftAndRight(i);
        if (view.getVisibility() == 0) {
            ˏˎ(view);
            ViewParent parent = view.getParent();
            if (parent instanceof View) {
                ˏˎ((View) parent);
            }
        }
    }

    private static void ˏˎ(View view) {
        float translationY = view.getTranslationY();
        view.setTranslationY(1.0f + translationY);
        view.setTranslationY(translationY);
    }

    public static void ˎ(@NonNull View view, Rect rect) {
        if (VERSION.SDK_INT >= 18) {
            view.setClipBounds(rect);
        }
    }

    @Nullable
    public static Rect ˉ(@NonNull View view) {
        if (VERSION.SDK_INT >= 18) {
            return view.getClipBounds();
        }
        return null;
    }

    public static boolean ˋˊ(@NonNull View view) {
        if (VERSION.SDK_INT >= 19) {
            return view.isAttachedToWindow();
        }
        return view.getWindowToken() != null;
    }

    public static boolean ˊˋ(@NonNull View view) {
        if (VERSION.SDK_INT >= 15) {
            return view.hasOnClickListeners();
        }
        return false;
    }

    public static void ˎ(@NonNull View view, int i, int i2) {
        if (VERSION.SDK_INT >= 23) {
            view.setScrollIndicators(i, i2);
        }
    }

    public static void ˋ(@NonNull View view, hz hzVar) {
        if (VERSION.SDK_INT >= 24) {
            view.setPointerIcon((PointerIcon) (hzVar != null ? hzVar.ˋ() : null));
        }
    }

    @Nullable
    public static Display ˍ(@NonNull View view) {
        if (VERSION.SDK_INT >= 17) {
            return view.getDisplay();
        }
        if (ˋˊ(view)) {
            return ((WindowManager) view.getContext().getSystemService("window")).getDefaultDisplay();
        }
        return null;
    }

    protected ViewCompat() {
    }

    @UiThread
    public static boolean ˊ(View view, KeyEvent keyEvent) {
        if (VERSION.SDK_INT >= 28) {
            return false;
        }
        return d.ˊ(view).ˋ(keyEvent);
    }

    @UiThread
    public static boolean ॱ(View view, KeyEvent keyEvent) {
        if (VERSION.SDK_INT >= 28) {
            return false;
        }
        return d.ˊ(view).ˊ(view, keyEvent);
    }

    @UiThread
    public static boolean ˋᐝ(View view) {
        Boolean bool = (Boolean) ˊ().ˏ(view);
        return bool == null ? false : bool.booleanValue();
    }

    private static a<Boolean> ˊ() {
        return new a<Boolean>(o.ff.d.ͺॱ, Boolean.class, 28) {
            @RequiresApi(28)
            /* synthetic */ Object ˊ(View view) {
                return ॱ(view);
            }

            @RequiresApi(28)
            Boolean ॱ(View view) {
                return Boolean.valueOf(view.isScreenReaderFocusable());
            }
        };
    }

    @UiThread
    public static CharSequence ˎˎ(View view) {
        return (CharSequence) ˏ().ˏ(view);
    }

    private static a<CharSequence> ˏ() {
        return new a<CharSequence>(o.ff.d.ˑ, CharSequence.class, 8, 28) {
            @RequiresApi(28)
            /* synthetic */ Object ˊ(View view) {
                return ˋ(view);
            }

            @RequiresApi(28)
            CharSequence ˋ(View view) {
                return view.getAccessibilityPaneTitle();
            }
        };
    }

    @UiThread
    public static boolean ˌ(View view) {
        Boolean bool = (Boolean) ˋ().ˏ(view);
        return bool == null ? false : bool.booleanValue();
    }

    private static a<Boolean> ˋ() {
        return new a<Boolean>(o.ff.d.ˏˏ, Boolean.class, 28) {
            @RequiresApi(28)
            /* synthetic */ Object ˊ(View view) {
                return ˋ(view);
            }

            @RequiresApi(28)
            Boolean ˋ(View view) {
                return Boolean.valueOf(view.isAccessibilityHeading());
            }
        };
    }

    @RequiresApi(19)
    static void ᐝ(View view, int i) {
        if (((AccessibilityManager) view.getContext().getSystemService("accessibility")).isEnabled()) {
            Object obj = ˎˎ(view) != null ? 1 : null;
            if (ॱॱ(view) != 0 || (obj != null && view.getVisibility() == 0)) {
                AccessibilityEvent obtain = AccessibilityEvent.obtain();
                obtain.setEventType(obj != null ? 32 : 2048);
                obtain.setContentChangeTypes(i);
                view.sendAccessibilityEventUnchecked(obtain);
            } else if (view.getParent() != null) {
                try {
                    view.getParent().notifySubtreeAccessibilityStateChanged(view, view, i);
                } catch (Throwable e) {
                    Log.e("ViewCompat", view.getParent().getClass().getSimpleName() + " does not fully implement ViewParent", e);
                }
            }
        }
    }
}
